Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(web): plugin playground preset plugin add geojson #1344

Merged
merged 20 commits into from
Jan 16, 2025

Conversation

ShogoHirasawa
Copy link
Contributor

@ShogoHirasawa ShogoHirasawa commented Jan 10, 2025

Overview

Added a preset that shows how to add GeoJSON in the layers part of the Plugin playground.

What I've done

  • Set up a tab for layers
  • Create sample JavaScript code and yaml with instructions on how to add GeoJSON
スクリーンショット 2025-01-10 14 22 11

What I haven't done

Once this task is completed, I will create a CZML sample next.

How I tested

The Cesium token for the playground in the local environment was expired, so I tested with https://visualizer.test.reearth.dev.
スクリーンショット 2025-01-10 14 22 41

Which point I want you to review particularly

  • Is the comment-out in the script appropriate?
  • Are script variables named appropriately?
  • Is the amount of text in the script appropriate?

Memo

Summary by CodeRabbit

  • New Features
    • Added a new "layers" category to plugin presets.
    • Introduced a GeoJSON layer plugin that allows adding layers from inline data or URL.
    • Supports adding polygon, polyline, and point layers to the Re:Earth platform.
    • Updated the title of the "UI" category to "User Interface".

Copy link

coderabbitai bot commented Jan 10, 2025

Walkthrough

This pull request introduces a new GeoJSON plugin to the Plugin Playground feature. A new "layers" category is added to the preset plugins, which includes an addGeojson plugin. The new plugin provides functionality for adding GeoJSON layers to the Re:Earth platform, with examples for adding layers both inline and from a URL. Additionally, the title of the existing "ui" category is updated to "User Interface".

Changes

File Change Summary
web/src/beta/features/PluginPlayground/Plugins/presets/index.ts Added new "layers" category to presetPlugins with addGeojson plugin; updated title from "UI" to "User Interface"
web/src/beta/features/PluginPlayground/Plugins/presets/layers/add-geojson.ts Created new plugin file defining GeoJSON layer addition with inline and URL-based examples

Possibly related PRs

Suggested reviewers

  • mkumbobeaty
  • m-abe-dev

Poem

🌍 A rabbit's geospatial delight,
Layers dancing, data taking flight!
GeoJSON spreads its spatial wings,
Re:Earth now knows what mapping brings.
Hop, hop, hurray for spatial play! 🐰🗺️

Finishing Touches

  • 📝 Generate Docstrings (Beta)

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

netlify bot commented Jan 10, 2025

Deploy Preview for reearth-web ready!

Name Link
🔨 Latest commit 8c2ca82
🔍 Latest deploy log https://app.netlify.com/sites/reearth-web/deploys/6788e23c8284df000796e9c9
😎 Deploy Preview https://deploy-preview-1344--reearth-web.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (4)
web/src/beta/features/PluginPlayground/Plugins/presets/index.ts (1)

28-30: Maintain consistent title casing across categories

The title "layers" should follow the same title case convention as other categories ("Custom" and "UI").

-    title: "layers",
+    title: "Layers",
web/src/beta/features/PluginPlayground/Plugins/presets/layers/add-geojson.ts (3)

29-30: Fix typo in comment and enhance variable naming

The comment contains a typo and the variable name could be more specific about the shape.

-// Difine the polygon with inline
-const layerGeojsonInline = {
+// Define the polygon with inline GeoJSON data
+const inlinePolygonLayer = {

61-62: Fix typo in comment and enhance variable naming

Similar issues in the second example.

-// Difine the polygon with URL
-const layerGeojsonFromUrl = {
+// Define the polygon from URL
+const urlPolygonLayer = {

27-59: Enhance code comments for better guidance

While the comments are helpful, they could be more detailed to better guide users. Consider adding:

  • Purpose of each property
  • Format requirements
  • Styling options available in the polygon property

Example enhancement:

// Example of adding a GeoJSON polygon layer with inline data
// This demonstrates how to create a simple polygon layer with coordinates

const inlinePolygonLayer = {
  id: "feature001",  // Unique identifier for referencing the layer
  type: "simple",    // Layer type: "simple" for basic geometry
  data: {
    type: "geojson", // Data format specification
    value: {
      // GeoJSON object following RFC 7946 specification
      type: "FeatureCollection",
      // ... rest of the code
    },
  },
  polygon: {
    // Style options available:
    // - fill: boolean
    // - fillColor: string (hex)
    // - stroke: boolean
    // - strokeColor: string (hex)
    // - strokeWidth: number
  },
};
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9441b7b and 4ca3a41.

📒 Files selected for processing (2)
  • web/src/beta/features/PluginPlayground/Plugins/presets/index.ts (2 hunks)
  • web/src/beta/features/PluginPlayground/Plugins/presets/layers/add-geojson.ts (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: Redirect rules - reearth-web
  • GitHub Check: Header rules - reearth-web
  • GitHub Check: Pages changed - reearth-web
🔇 Additional comments (2)
web/src/beta/features/PluginPlayground/Plugins/presets/layers/add-geojson.ts (2)

80-84: LGTM! Clean and well-structured export

The exported constant follows the correct type structure and provides a clear interface for the plugin.


67-67: Verify sample GeoJSON URL accessibility

Let's verify that the sample URL is accessible and contains valid GeoJSON data.

✅ Verification successful

Sample GeoJSON URL is valid and accessible

The URL points to a valid GeoJSON FeatureCollection and is publicly accessible.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check if the URL is accessible and returns valid GeoJSON
curl -s "https://reearth.github.io/visualizer-plugin-sample-data/public/geojson/square.geojson" | jq 'if type=="object" and .type=="FeatureCollection" then "Valid GeoJSON" else "Invalid GeoJSON" end'

Length of output: 215

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

♻️ Duplicate comments (1)
web/src/beta/features/PluginPlayground/Plugins/presets/layers/add-geojson.ts (1)

10-10: ⚠️ Potential issue

Extension ID must match the JavaScript file name

The extension ID must exactly match the JavaScript file name (without extension) for the extension to be loaded properly.

-    - id: add geojson
+    - id: add-geojson
🧹 Nitpick comments (3)
web/src/beta/features/PluginPlayground/Plugins/presets/layers/add-geojson.ts (3)

30-30: Fix typo in comments

There's a typo in the comments: "Difine" should be "Define".

-// Difine the polygon with inline
+// Define the polygon with inline
-// Difine the polygon with URL
+// Define the polygon with URL

Also applies to: 62-62


45-51: Consider making coordinates configurable

The hardcoded coordinates could be made more configurable through properties or parameters to improve reusability.

Consider extracting these coordinates to a configuration object or making them customizable through the plugin interface.


27-28: Enhance code comments

While the current comments provide basic information, they could be more descriptive to better explain the GeoJSON structure and its components.

Consider adding more detailed comments explaining:

  • The purpose of each GeoJSON component (Feature, FeatureCollection, etc.)
  • The expected format of coordinates
  • The available style options for polygons

Also applies to: 32-32, 34-34, 37-37, 40-40, 43-43

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4ca3a41 and e2bda78.

📒 Files selected for processing (1)
  • web/src/beta/features/PluginPlayground/Plugins/presets/layers/add-geojson.ts (1 hunks)
🧰 Additional context used
📓 Learnings (1)
web/src/beta/features/PluginPlayground/Plugins/presets/layers/add-geojson.ts (1)
Learnt from: airslice
PR: reearth/reearth-visualizer#1344
File: web/src/beta/features/PluginPlayground/Plugins/presets/layers/add-geojson.ts:10-10
Timestamp: 2025-01-10T06:45:01.558Z
Learning: In Re:Earth visualizer plugins, the extension ID in reearth.yml must exactly match the JavaScript file name (without extension) for the extension to be loaded properly.
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: Redirect rules - reearth-web
  • GitHub Check: Header rules - reearth-web
  • GitHub Check: Pages changed - reearth-web
🔇 Additional comments (2)
web/src/beta/features/PluginPlayground/Plugins/presets/layers/add-geojson.ts (2)

31-31: Remove layer IDs

As per previous feedback, layer IDs should not be provided.

-  id:"feature001",
-  id:"feature002",

Also applies to: 63-63


80-84: LGTM!

The plugin export configuration is correct and follows the required format.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

♻️ Duplicate comments (1)
web/src/beta/features/PluginPlayground/Plugins/presets/layers/add-geojson.ts (1)

10-10: ⚠️ Potential issue

Extension ID must match the JavaScript file name

The extension ID must exactly match the JavaScript file name (without extension) for the extension to be loaded properly.

-    - id: add geojson
+    - id: add-geojson
🧹 Nitpick comments (2)
web/src/beta/features/PluginPlayground/Plugins/presets/layers/add-geojson.ts (2)

29-29: Fix typo in comments

There's a recurring typo in the comments: "Difine" should be "Define".

Also applies to: 61-61, 72-72, 104-104, 115-115


77-100: Maintain consistent JSON formatting

The GeoJSON structure has inconsistent indentation and quote styles. Consider using a consistent style throughout.

     value: {
-  "type": "FeatureCollection",
-  "features": [
+      type: "FeatureCollection",
+      features: [
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e2bda78 and d9a6a8f.

📒 Files selected for processing (1)
  • web/src/beta/features/PluginPlayground/Plugins/presets/layers/add-geojson.ts (1 hunks)
🧰 Additional context used
📓 Learnings (1)
web/src/beta/features/PluginPlayground/Plugins/presets/layers/add-geojson.ts (1)
Learnt from: airslice
PR: reearth/reearth-visualizer#1344
File: web/src/beta/features/PluginPlayground/Plugins/presets/layers/add-geojson.ts:10-10
Timestamp: 2025-01-10T06:45:01.558Z
Learning: In Re:Earth visualizer plugins, the extension ID in reearth.yml must exactly match the JavaScript file name (without extension) for the extension to be loaded properly.
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: Redirect rules - reearth-web
  • GitHub Check: Header rules - reearth-web
  • GitHub Check: Pages changed - reearth-web
🔇 Additional comments (1)
web/src/beta/features/PluginPlayground/Plugins/presets/layers/add-geojson.ts (1)

127-138: 🛠️ Refactor suggestion

Add error handling and fix comment accuracy

  1. Add error handling for URL fetches
  2. Fix incorrect comments for polyline operations
 // Add the inline polygon layer to Re:Earth
-reearth.layers.add(layerPolygonInline);
+reearth.layers.add(layerPolygonInline).catch(error => {
+  console.error("Failed to add polygon layer:", error);
+});

 // Add the polygon layer from the URL to Re:Earth
-reearth.layers.add(layerPolygonFromUrl);
+reearth.layers.add(layerPolygonFromUrl).catch(error => {
+  console.error("Failed to load polygon from URL:", error);
+});

-// Add the polyline layer from the URL to Re:Earth
+// Add the inline polyline layer to Re:Earth
-reearth.layers.add(layerPolylineInline);
+reearth.layers.add(layerPolylineInline).catch(error => {
+  console.error("Failed to add polyline layer:", error);
+});

-// Add the inline polyline layer to Re:Earth
+// Add the polyline layer from the URL to Re:Earth
-reearth.layers.add(layerPolylineFromUrl);
+reearth.layers.add(layerPolylineFromUrl).catch(error => {
+  console.error("Failed to load polyline from URL:", error);
+});

Likely invalid or redundant comment.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Nitpick comments (1)
web/src/beta/features/PluginPlayground/Plugins/presets/layers/add-geojson.ts (1)

29-29: Fix typo in comments

"Difine" should be "Define" in multiple comments.

-// Difine the polygon with inline
+// Define the polygon with inline

Also applies to: 61-61, 72-72, 98-98, 109-109, 132-132

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d9a6a8f and 951d639.

📒 Files selected for processing (1)
  • web/src/beta/features/PluginPlayground/Plugins/presets/layers/add-geojson.ts (1 hunks)
🧰 Additional context used
📓 Learnings (1)
web/src/beta/features/PluginPlayground/Plugins/presets/layers/add-geojson.ts (1)
Learnt from: airslice
PR: reearth/reearth-visualizer#1344
File: web/src/beta/features/PluginPlayground/Plugins/presets/layers/add-geojson.ts:10-10
Timestamp: 2025-01-10T06:45:01.558Z
Learning: In Re:Earth visualizer plugins, the extension ID in reearth.yml must exactly match the JavaScript file name (without extension) for the extension to be loaded properly.
🔇 Additional comments (2)
web/src/beta/features/PluginPlayground/Plugins/presets/layers/add-geojson.ts (2)

3-22: LGTM! YAML configuration is properly structured.

The extension ID correctly matches the JavaScript file name as required.


163-167: LGTM! Plugin exports are properly structured.

The export configuration is correct with matching IDs and required files.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (3)
web/src/beta/features/PluginPlayground/Plugins/presets/layers/add-geojson.ts (3)

29-29: Fix typo in comments

There's a typo in the word "Difine" in multiple comments.

-// Difine the GeoJSON  with inline
+// Define the GeoJSON with inline

-// Difine the GeoJSON with URL
+// Define the GeoJSON with URL

Also applies to: 83-83


31-33: Improve code comments

The comments could be more descriptive to better explain the purpose of each configuration section.

-  id: "features001", // A unique identifier for the layer
-  type: "simple", // Must be written
-  data: {
+  // Unique identifier for the layer. Must be unique across all layers in the scene
+  id: "features001",
+  // Layer type. 'simple' is used for basic GeoJSON visualization
+  type: "simple",
+  data: {

-  // Settings for the feature style. This statement is required even if no style is set.
-  polygon: {},
-  polyline: {},
-  marker: {},
+  // Style settings for each geometry type
+  // These blocks are required even if empty, to properly render the GeoJSON
+  polygon: {}, // Styles for Polygon/MultiPolygon geometries
+  polyline: {}, // Styles for LineString/MultiLineString geometries
+  marker: {}, // Styles for Point/MultiPoint geometries

Also applies to: 77-80


24-103: Addressing your specific feedback requests:

  1. Comments: While present, they could be more descriptive and educational. I've suggested improvements above.
  2. Variable naming: The current naming convention is clear and consistent (layerGeojsonInline, layerGeojsonFromUrl).
  3. Text amount: The code is well-balanced with an appropriate amount of comments. Consider adding a brief header comment explaining the plugin's purpose.

Add a header comment at the start of the widget file:

+/**
+ * GeoJSON Layer Plugin
+ * 
+ * This plugin demonstrates how to add GeoJSON layers to Re:Earth using both
+ * inline data and external URLs. It showcases different geometry types:
+ * - Polygons
+ * - LineStrings
+ * - Points
+ */
 // Example of adding a layer with GeoJSON data
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 951d639 and db38003.

📒 Files selected for processing (1)
  • web/src/beta/features/PluginPlayground/Plugins/presets/layers/add-geojson.ts (1 hunks)
🧰 Additional context used
📓 Learnings (1)
web/src/beta/features/PluginPlayground/Plugins/presets/layers/add-geojson.ts (1)
Learnt from: airslice
PR: reearth/reearth-visualizer#1344
File: web/src/beta/features/PluginPlayground/Plugins/presets/layers/add-geojson.ts:10-10
Timestamp: 2025-01-10T06:45:01.558Z
Learning: In Re:Earth visualizer plugins, the extension ID in reearth.yml must exactly match the JavaScript file name (without extension) for the extension to be loaded properly.
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: Redirect rules - reearth-web
  • GitHub Check: Header rules - reearth-web
  • GitHub Check: Pages changed - reearth-web
🔇 Additional comments (3)
web/src/beta/features/PluginPlayground/Plugins/presets/layers/add-geojson.ts (3)

90-90: Consider using a more reliable data source

The external URL dependency could be risky if the sample data becomes unavailable.

Consider either:

  1. Bundling the sample GeoJSON with the plugin
  2. Using a more stable hosting solution
  3. Adding fallback data when the URL is unreachable

105-109: LGTM!

The plugin export is well-structured and correctly includes both the widget and YAML files.


98-101: 🛠️ Refactor suggestion

Add error handling for layer operations

Layer operations should include error handling to gracefully handle failures.

 // Add the inline GeoJSON layer to Re:Earth
-reearth.layers.add(layerGeojsonInline);
+reearth.layers.add(layerGeojsonInline).catch(error => {
+  console.error("Failed to add inline GeoJSON layer:", error);
+});

 // Add the GeoJSON layer from the URL to Re:Earth
-reearth.layers.add(layerGeojsonFromUrl);
+reearth.layers.add(layerGeojsonFromUrl).catch(error => {
+  console.error("Failed to add GeoJSON layer from URL:", error);
+});

Likely invalid or redundant comment.

@ShogoHirasawa
Copy link
Contributor Author

ShogoHirasawa commented Jan 14, 2025

what I did

  • Added polyline and marker examples
  • Changed the script to add separate layers for url and inline.

what I will do

  • Creating CZML examples

@github-actions github-actions bot added the web label Jan 16, 2025
@airslice airslice changed the title feat(web) plugin playground presets add geojson feat(web): plugin playground preset plugin add geojson Jan 16, 2025
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

♻️ Duplicate comments (2)
web/src/beta/features/PluginPlayground/Plugins/presets/layers/add-geojson.ts (2)

10-10: ⚠️ Potential issue

Fix extension ID to match JavaScript filename

The extension ID must exactly match the JavaScript file name (without extension) for the extension to be loaded properly.

-    - id: layers-add-geojson
+    - id: add-geojson

102-105: 🛠️ Refactor suggestion

Add error handling for layer operations

The layer additions lack error handling for potential failures, especially for URL-based layers.

 // Add the inline GeoJSON layer to Re:Earth
-reearth.layers.add(layerGeojsonInline);
+reearth.layers.add(layerGeojsonInline).catch(error => {
+  console.error("Failed to add inline GeoJSON layer:", error);
+});

 // Add the GeoJSON layer from the URL to Re:Earth
-reearth.layers.add(layerGeojsonFromUrl);
+reearth.layers.add(layerGeojsonFromUrl).catch(error => {
+  console.error("Failed to add GeoJSON layer from URL:", error);
+});
🧹 Nitpick comments (1)
web/src/beta/features/PluginPlayground/Plugins/presets/layers/add-geojson.ts (1)

29-30: Improve code comments for better clarity

The current comment is too generic. Add more specific details about the GeoJSON structure being defined.

-// Define the GeoJSON inline
+// Define a FeatureCollection containing a polygon, a polyline, and a point
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a7dd8bf and 5efa4e5.

📒 Files selected for processing (2)
  • web/src/beta/features/PluginPlayground/Plugins/presets/index.ts (2 hunks)
  • web/src/beta/features/PluginPlayground/Plugins/presets/layers/add-geojson.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • web/src/beta/features/PluginPlayground/Plugins/presets/index.ts
🧰 Additional context used
📓 Learnings (1)
web/src/beta/features/PluginPlayground/Plugins/presets/layers/add-geojson.ts (1)
Learnt from: airslice
PR: reearth/reearth-visualizer#1344
File: web/src/beta/features/PluginPlayground/Plugins/presets/layers/add-geojson.ts:10-10
Timestamp: 2025-01-10T06:45:01.558Z
Learning: In Re:Earth visualizer plugins, the extension ID in reearth.yml must exactly match the JavaScript file name (without extension) for the extension to be loaded properly.
🔇 Additional comments (2)
web/src/beta/features/PluginPlayground/Plugins/presets/layers/add-geojson.ts (2)

109-113: LGTM! Export configuration is well-structured

The plugin export is correctly configured with:

  • ID matching the filename
  • Appropriate title
  • Complete files array

82-89: Fix typo in comment and improve URL reliability

There's a typo in the comment, and the external URL dependency could be unreliable.

-// Difine the GeoJSON with URL
+// Define the GeoJSON from URL

Consider:

  1. Bundling sample GeoJSON files with the plugin
  2. Moving them to a more stable hosting location
  3. Adding fallback data when URLs are unreachable

Run this script to verify URL accessibility:

✅ Verification successful

Typo fix is valid, but URL reliability is not a concern

The comment has a typo ("Difine" → "Define"), but the URL is hosted on GitHub Pages and is currently accessible. Since this is sample data in a preset, the current hosting solution is appropriate for its purpose.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check if the sample data URL is accessible
url="https://reearth.github.io/visualizer-plugin-sample-data/public/geojson/sample_polygon_polyline_marker.geojson"
status=$(curl -s -o /dev/null -w "%{http_code}" "$url")
echo "URL Status: $status"

Length of output: 321

@airslice airslice merged commit 5a6b1a3 into main Jan 16, 2025
17 checks passed
@airslice airslice deleted the feat(web)-plugin-playground-presets-add-geojson branch January 16, 2025 10:46
hexaforce pushed a commit that referenced this pull request Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants